package cn.wolfcode.productapi.feign;

import cn.wolfcode.productapi.domain.Product;
import cn.wolfcode.productapi.feign.hystrix.ProducHystrax;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@FeignClient(value = "PRODUCT-SERVER", fallback = ProducHystrax.class)
public interface IProductFeignApi {

    //服务中向外暴露的方法, 和controller中的方法一样
    @RequestMapping("/get")
    Product get(@RequestParam("id") long id);//指定请求映射的参数的名字

}
